import React from 'react';
import { connect } from 'dva';
import ShowTypeComponent from '../../components/Common/ShowType/ShowType';

function ShowType({ dispatch, app, ...props }) {
  function getAddPane(pane) {
    /* 增加标签 */
    dispatch({ type: 'app/addppopupPane', payload: { pane } });
  }
  function getSecondAddPane(pane) {
    /* 增加标签 */
    dispatch({ type: 'app/addSecondPpopupPane', payload: { pane } });
  }
  const showTypeProps = {
    ...props,
    app,
    dispatch,
    onAddPane: getAddPane,
    onAddSecondPane: getSecondAddPane,
  };

  return (
    <ShowTypeComponent {...showTypeProps} />
  );
}

export default connect(({ showType, app }) =>
  ({ showType, app }))(ShowType);
